package math.vectorSpace.R2;

public class Line2D {

    private Point2D refPoint;

    private Vector2D dirVector;

    public Line2D(Point2D refPoint, Vector2D dirVector) {
        this.refPoint = refPoint;
        this.dirVector = dirVector;
    }

    public Line2D(Point2D point1, Point2D point2) {
        this.refPoint = point1;
        this.dirVector = new Vector2D(point1, point2);
    }

    public Line2D(double rX, double rY, double vX, double vY) {
        this.refPoint = new Point2D(rX, rY);
        this.dirVector = new Vector2D(vX, vY);
    }

    public Point2D getRefPoint() {
        return refPoint;
    }

    public Vector2D getDirVector() {
        return dirVector;
    }

    @Override
    public String toString() {
        return ("Line2D (" + Double.toString(this.refPoint.getX()) + ", "
                + Double.toString(this.refPoint.getY()) + ") + t["
                + Double.toString(this.dirVector.getX()) + ", "
                + Double.toString(this.dirVector.getY()) + "]");
    }
}
